var app =angular.module('myApp');
app.controller('f-edit',["$css","$http","$scope","$rootScope",function ($css,$http,$scope,$rootScope) {
    $css.add("./collect/css/edit.css");
    $scope.data = JSON.parse(localStorage.getItem('collectData'));
    $scope.sameData = JSON.parse(localStorage.getItem('sameData'));
    // console.log($scope.sameData);
    $scope.flag = false;
    //$scope.shanchu = false;
    // $scope.dl = function(){
    //     $scope.shanchu = true;
    //     var divs = document.getElementsByClassName("f-xuanze");
    //      console.log(divs);
    //     for(var i = 0 ; i < divs.length ; i++){
    //         if($(divs[i]).attr('class') == 'f-xuanze f01-'){
    //             $scope.data.splice(i,1);
    //         }
    //     }
    // }
    // $scope.shanchu = false;
    // console.log($scope.data);
    // $scope.data.pop();
    //$rootScope.bianji =$scope.data;
    // console.log(localStorage.getItem('collectData'));
    // console.log($scope.getData);
    // localStorage.clear('collectData');
    $scope.dele = function(){
        //console.log($('.f-xuanze'));
        var divs = document.getElementsByClassName("f-xuanze");
        // console.log(divs);
        for(var i = 0 ; i < divs.length ; i++){
            if($(divs[i]).attr('class') == 'f-xuanze f01-a'){
                $scope.data.splice(i,1);
                $scope.sameData.splice(i,1);
            }
        }
        localStorage.setItem('collectData',JSON.stringify($scope.data))
        localStorage.setItem('sameData',JSON.stringify($scope.sameData))
    }
}])
